package com.example.zhangguoqing.homeofpet.data;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;

import com.example.zhangguoqing.homeofpet.R;

public class dataActivity extends AppCompatActivity {

    TextView temp;
    TextView wet;
    TextView EC;
    ImageButton button;
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature( Window.FEATURE_NO_TITLE);// 去掉标题,
        setContentView(R.layout.fragment_data);
        button=(ImageButton)findViewById( R.id.imageButton );
        button.setOnClickListener( new ButtonListener() );
        temp=(TextView) findViewById( R.id.getTemp );
        wet=(TextView) findViewById( R.id.getWet );
        EC=(TextView) findViewById( R.id.getEC );

    }
    class ButtonListener implements View.OnClickListener{

        @Override
        public void onClick(View v) {
            temp.setText( "35 ℃" );

            wet.setText( "80%" );
            EC.setText( "2.6mmhos/cm" );
        }
    }
}
